package  main

import (
	"fmt";
	"encoding/json"
)

type Print struct{
	x int
	y int
}

type Rect struct {
	leftUp,rightDown Print
}
type Monster struct{
	Name string `json:"name"`
	Age int `json:"age"`
	Address string `json:"address"`// 这样可以 打印出来的值是 小写的 字母开头
}
func main(){
	r1:=Rect{
		Print{10,20},
		Print{20,30},
	}
	fmt.Println(r1.leftUp,r1.rightDown)

	monster:=Monster{
		"牛魔王",
		500,
		"火焰山",
	}
	jsonStr,err:=json.Marshal(monster)
	if err!=nil{
		fmt.Println("亲 报错了")
	}else{
		fmt.Println(string(jsonStr))
	}
}